package com.cn.service.exception;

/**
 * 业务错误代码枚举类
 * 
 * @author ZSL
 *
 */
public enum ErrorCode {

	/**
	 * 错误的请求
	 */
	BAD_REQUEST(400, 400),
	/**
	 * 未认证
	 */
	UNAUTHORIZED(401, 401),
	/**
	 * 禁止
	 */
	FORBIDDEN(403, 403),
	/**
	 * 内部错误
	 */
	INTERNAL_SERVER_ERROR(500, 500),

	/**
	 * 无权限禁止访问---借图书
	 */
	BOOK_STATUS_WRONG(1100, 400),
	/**
	 * 
	 */
	BOOK_OWNERSHIP_WRONG(1101, 403),
	/**
	 * 无TOKEN标识符
	 */
	NO_TOKEN(1102, 401);

	private int code;
	private int httpStatus;
	private String message;
	private Object object;

	
	/**
	 * 错误码构造函数
	 * 
	 * @param code 业务状态码
	 * @param httpStatus 请求响应码
	 */
	ErrorCode(int code, int httpStatus,String message,Object object) {
		this.code = code;
		this.httpStatus = httpStatus;
		this.message = message;
		this.object = object;
	}
	
	ErrorCode(int code, int httpStatus) {
		this.code = code;
		this.httpStatus = httpStatus;
	}
	
	

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public int getHttpStatus() {
		return httpStatus;
	}

	public void setHttpStatus(int httpStatus) {
		this.httpStatus = httpStatus;
	}

	public Object getObject() {
		return object;
	}

	public void setObject(Object object) {
		this.object = object;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	
	
	
}
